Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target .NET 8, #928 #982

Merged
merged 4 commits into from
Oct 22, 2024
Merged

Target .NET 8, #928 #982

merged 4 commits into from
Oct 22, 2024

Conversation

paulirwin
Copy link
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Adds the .NET 8 target.

Fixes #928

Description

This PR adds the .NET 8 target. Due to a conflict between extension methods in .NET 8 and J2N, we added new methods to Collections to create J2N read-only collections instead of using the extension method. The unit tests will use the net8.0 targets when run under .NET 8 now, instead of net6.0.

Additionally, this resolves a warning when running the .NET 5 tests, and ensures the _artifacts/NuGetPackages folder is created in the build script before restore, which is helpful when you add that folder as a local path in your NuGet sources for testing purposes.

@paulirwin paulirwin requested a review from NightOwl888 October 21, 2024 23:15
…RMATTRIBUTE so we don't have an #ifdef hard coded to a specific target framework. This fixes the CA1416 warning after targeting net8.0, and will make future targeting simpler.
Copy link
Contributor

@NightOwl888 NightOwl888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

The changes look good.

This brings us from 93% to 95% of the allowed 10GB on Azure Pipelines, so we are good for now. After #981, this target only brought us from the original distribution size of 127MB up to 130MB.

There was a prior change that hard coded the net6.0 target framework in NativeFSLockFactory which triggered a build warning after the upgrade, which I have addressed in a way that is tolerant of future target framework changes.

src/Lucene.Net/Support/Collections.cs Outdated Show resolved Hide resolved
@paulirwin paulirwin merged commit 4a190ff into apache:master Oct 22, 2024
199 checks passed
@paulirwin paulirwin deleted the issue/928 branch October 22, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Target .NET 8
2 participants